<?php
/*
 * This is for folder menu
 */
$rp = $_SERVER['REQUEST_URI'];
?>

<div class="salus_bank_reg float_left">


    <a class="float_left" href="http://<?= $_SERVER['HTTP_HOST'] ?>/salusme/user">
        <!--                    <div class="salus_bank_logo logo"></div>-->
        <img src="../../include/images/logo_sakusbank.png" width="104px;" height="60px;" />                
        <div class="down_arrow"></div>
    </a>

    <?php
    $getbaby = mysql_query("select * from salus_buy_product where FK_fa_user_id='" . $_COOKIE['gid'] . "' and product_id ='2'  ") or die(mysql_error());
    if (mysql_num_rows($getbaby) != 0) {
        ?>
        <a class="float_left" href="http://<?= $_SERVER['HTTP_HOST'] ?>/salusbaby" >
            <img src="../../include/images/baby.png" width="104px;" height="50px;" />
        </a>
    <?php }
    ?>
    <div class="clear"></div>

    <div class="float_left top_menu "><a href="">VIEW FOLDER</a></div>

    <div class="clear"></div>
    <div class="clear"></div>
    <script>
        $(function(){
            $('#dlg').click(function(){$('#dialog').dialog('open');return false;});
            $('#dlg2').click(function(){$('#dialog2').dialog('open');return false;});
            $('#dlg3').click(function(){$('#dialog3').dialog('open');return false;});
            $('#dialog2').dialog({
                fontSize : '10',
                autoOpen : false,
                modal : true,
                width : 'auto',
                height: 'auto',
                resizable : false,                       
                buttons: {                           
                    "Don't Save": function() {
                        $(this).dialog("close");
                    }
                }
            });
            $("#dialog").dialog({
                autoOpen : false,
                modal : true,
                width : 'auto',
                height: 'auto',
                resizable : false,                       
                buttons: {                           
                    "Don't Save": function() {
                        $(this).dialog("close");
                    }
                }
            });
            $("#dialog3").dialog({
                autoOpen : false,
                modal : true,
                width : 'auto',
                height: 'auto',
                resizable : false,                       
                buttons: {                           
                    "Don't Save": function() {
                        $(this).dialog("close");
                    }
                }
            });
            $( "#datepicker1,#datepicker2,#datepicker3" ).datepicker({
                showOn: "button",
                buttonImage: "../../include/images/calendar.gif",
                buttonImageOnly: true
            });
        });
    </script>

    <div class="float_right" style="width: 210px">

        <!--        <div class="float_right top_after_menu"><a href="http://www.ndroid360.com/salus/index.php/salus_bank/gen_pdf"><img id="send_mail" src="http://www.ndroid360.com/salus/public/frontend/images/icons/send.png" title="Send Email"/></a></div>-->
        <form id="ffr" name="ffr" method="post" action="">

            <input type="hidden" id="maildata" name="maildata">
<!--            <div class="float_right top_after_menu"><a href="<?= 'http://' . $_SERVER['HTTP_HOST'] . '/salusbaby/user/view/profile_print?actor=CHILD' ?>" ><img id="send_mail" src="../../include/images/send.png" title="Send Email"/></a></div>-->

        </form>
<!--            <div class="float_right top_after_menu"><a><img onclick="PrintElem('#mainContent')" src="../../include/images/print.png" title="Print"/></a></div>-->
        <div class="float_right top_after_menu"><a href="#" id="dlg2" ><img src="../../include/images/import.png" title="Import"/></a></div>
        <div class="float_right top_after_menu"  style="width: 30px"><a href=""><img src="../../include/images/edit_icon.png" title="Edit"/></a></div>
        <div class="float_right top_after_menu"><a href="#" id="dlg" ><img src="../../include/images/new.png" title="New"/></a></div>
    </div>    
    <div class="clear"></div>

    <div id="dialog" title="Create New Folder" >

        <form id="new_folder"  method="post" action="create_folder.php" >
            <table>
                <tr>
                    <td>Folder Name :</td>
                    <td><input type="text" placeholder="folder name" name="folder" required /></td>
                </tr>       
                <tr>
                    <td>Password :</td>
                    <td><input type="password" placeholder="password" name="pass" required /> </td>
                </tr>
                <tr>
                    <td><input type="hidden" value="<?= $_COOKIE['gid'] ?>" name="uid" /> </td>
                    <td><input type="submit" value="Create Folder" /></td>
                </tr>
            </table>

        </form>

    </div>
    <div id="dialog2" title="Import Files to your personal Folders"  >
        <form method="post" enctype="multipart/form-data" action="../../plugins/upload_file.php" >

            <table>
                <tr>
                    <td>File Name :</td>
                    <td><input type="text" name="attr" required ></td>
                </tr>
                <tr>
                    <td>File :</td>
                    <td><input type="file" name="uploadedfile" required /></td>
                </tr>
                <tr>
                    <td>Folder :</td>
                    <td>
                        <select name="mdir" >
                            <?php
                            $flist = mysql_query("select * from me_folders where uid='" . $_COOKIE['gid'] . "'");
                            while ($row0 = mysql_fetch_array($flist)) {
                                ?>
                                <option name="mdir"  value="<?= $row0['folder'] ?>" ><?= $row0['folder'] ?></option>
                            <?php }
                            ?>

                        </select>
                    </td>
                </tr>
                <tr>
                    <td> <input type="hidden" name="MAX_FILE_SIZE" value="100000000000" />
                        <input type="hidden" name="per" value="personal" /></td>
                <input type="hidden" name="rp" value="<?= $rp ?>" />
                <input type="hidden" name="uid" value="<?= $_COOKIE['gid'] ?>" />
                <td><input type="submit" value="Upload File"  /> </td>

                </tr>
            </table>
        </form>
    </div>